package cn.shop.cloud.web.util;


import org.apache.commons.codec.digest.DigestUtils;

/**
 * @program: work
 * @ClassName MD5Util
 * @description: MD5加密类
 * @author: 李尧坤
 * @create: 2024−12-19 20:34
 * @Version 1.0
 **/

public class MD5Util {

    /**
     * 加密方法
     * @param password 原始密码
     * @param salt 加密用的盐  1a2d3c4d
     * @return
     */
    public static String encode(String password,String salt){

        String newPwd = DigestUtils.md5Hex(""+salt.charAt(0)+salt.charAt(2)+password+salt.charAt(4)+salt.charAt(5));

        return newPwd;
    }


    public static void main(String[] args) {
        String str = encode("admin","1a2d3c4d");

        System.out.println(str);

    }
}

